<?
//设置需要搜索的表格的前缀后缀
$table_Suffix=$table_name;
$table=$table_Prefix.$table_Suffix;
?>


<?

$trans_nid = $_REQUEST ['nid'];

$sqlstr="SELECT * FROM $table where nid = '$trans_nid'";

$result = mysql_query($sqlstr);

while($row = mysql_fetch_array($result))
  {
  $detail             =$row;
  }

mysql_close($con);

//获取员工信息
$employee=select_one_line_all_items($table_Prefix."employee","nid = '".$_REQUEST['nid']."' ");

if(!file_exists(ROOT_PATH_."/uploadfiles/employee/"))
{
    mkdir(ROOT_PATH_."/uploadfiles/employee",0777,true);
    chmod(ROOT_PATH_."/uploadfiles/employee",0777);
}
//http://yitong.enpingshi.com/api/binding_wechat_and_employee.php?p=9@circledesign


//判断一下员工绑定二维码是否存在，不存在就生成。
//员工二维码时  employee/{emloyeenid}.png
//为员工生成绑定二维码
if(!file_exists(ROOT_PATH_."/uploadfiles/employee/".$employee['nid'].".png"))
{
    //echo "不存在";
    $parma['url']  = "https://oa.vanzetech.com/api/binding_wechat_and_employee.php?p=".$employee['nid'];
    $parma['name'] = $employee['nid'];
    $parma['local'] = ROOT_PATH_."/uploadfiles/employee/";

    $result=creat_qrcode($parma);
    //print_r2($result);

}
else
{
    $bind_code="";
}
?>


